<?php
/**
 * Session操作类
 */
class Session
{
    /**
     * 开启Session会话
     */
    public static function Start()
    {
        if(!isset($_SESSION)){
            session_start();
        }
    }

    /**
     * 获取Session
     */
    public static function Get($name)
    {
        self::Start();
        if(isset($_SESSION[$name])){
            return $_SESSION[$name];
        }
        else{
            return NULL;
        }
    }

    /**
     * 设置Session值
     */
    public static function Set($name,$value,$expire=NULL)
    {
        self::Start();
        $_SESSION[$name]=$value;
        return $_SESSION[$name];
    }

    /**
     * 清除所有Session
     */
    public static function Abandon()
    {
        session_unset();
        session_destroy();
    }
}
?>